package main

import "fmt"

func main() {
	m := map[string]string{}
	m["name"] = "张三"
	fmt.Printf("%+v\n", m)
	add(m)
	fmt.Printf("%+v\n", m)

	var u user = user{}
	u.addUser(&u)
	fmt.Printf("%+v\n", u)

	m1 := new(map[string]string)
	*m1 = map[string]string{}
	(*m1)["name"] = "李四"
	fmt.Printf("%+v\n", m1)
}

type user struct {
	name string
	sex  string
}

func add(m map[string]string) {
	m["sex"] = "男"
}

func (user) addUser(u *user) {
	u.name = "张三"
	u.sex = "难"
}
